Tag: json-schema

Blog Posts

The Null Equivalence Principle for JSON APIs

Most APIs should treat an omitted field the same way they treat a null one, and an empty value the same as both. Collapsing the three states cuts complexity and ambiguity. Distinct semantics are sometimes real, though. PATCH under RFC 7396 gives null a delete meaning, and GraphQL nullability and OpenAPI 3.1 union types raise the same question. When you need one of those, document the exception and enforce it.